import {getCommentList} from '../../api/api.js'
import { List } from 'vant';

export default{
	data(){
		return{
			skip:0,
			limit:10,
			commentLoading:false,
			commentFinished:false,
			commentList:[]//评论数量
		}
	},
	components:{
		[List.name]:List,
	},
	mounted(){
		
	},
	methods:{
		// 获取评论
		getCommentList(){
			let {uid,article_id,skip,limit} =this;
			getCommentList({
				user_id:uid,article_id,skip,limit
			}).then(res=>{
				if(res.code==0){
					this.commentList.push(...res.data);
					let len=this.commentList.length;
					if(len>=res.count){
						this.commentFinished=true
					}else{
						console.log(1);
						this.skip=len;
						this.commentLoading=false;
					}
				}
			})
		}
	}
}